# import requests, json
# from urllib3 import disable_warnings
# import re
#
# # def 函数():
# #     print("asd")
# #
# # 函数()
#
# # url = "http://japi.juhe.cn/qqevaluate/qq"
# #
# # querystring = {
# #     "key": "8dbee1fcd8627fb6699bce7b986adc45",
# #     "qq": "1928927616"
# # }
# # r = requests.get(url,params=querystring)
# # print(r.text)
# # print(json.dumps(r.json(), indent=4,ensure_ascii=False))
# # print(r.cookies)
# # print(dict(r.cookies))
# # print(r.encoding)
# # print(r.content.decode("utf-8"))
# #
# # url = "http://192.168.1.211:8080/config/payment/check"  #如果是https，请求中，需要加 verify=False
# #
# # querystring = {
# #         "age": 23,
# # 	    "yid": "20191213",
# #         "game_appkey": "LFo9FuZSz",
# #         "channel_code":"YOUKUTUDOU",
# #         "game_version": "1.0.0.23",
# #         "money":80,
# #         "charging_point":"0",
# #         "is_guest": 0,
# #         "sign": "0686d70be3b86cbbc05d66c47c9dcf21"
# #     }
# # r = requests.post(url, json=querystring)    #post请求是 data=    get请求是params=   需要加 verify=False忽略证书校验
# # print(r.text)
# # print(r.encoding)
# # h = "token"
# # c = "cookies"
# # #post 接口请求类型
# # #json
# # r = r.request.post(url, json=querystring)    #json= 会自动加上head头，content-Type:application/json
# # r = r.request.post(url, data=querystring, cookies=c)   #m默认是urlencoded 格式
# # r = r.request.get(url,parms=querystring, headers=h)    #get请求头部有参数的，例如：token 用headers
# # '''注释'''
#
#
# url = "http://49.235.92.12:8020/admin/login/?next=/admin/"
# #session  建立一个会话
# s = requests.session()
#
# # r1 = requests.get(url)
#
# r1 = s.get(url) #session发请求不用 request单独发送请求了
# # print(r1.text)
# # 需要的token 复制出来正则匹配要的数据 ：name='csrfmiddlewaretoken' value='M6wQsuOftGpgb0Vekf7zL0mPCGhLHM8X59qNuBohM6qLMH8t681hOPZ7i1B2znVZ'
# csrf_token = re.findall("'csrfmiddlewaretoken' value='(.+?)'", r1.text) #格式很重要，要与html里的一样，最好复制，不要有空格
# print(csrf_token[0])    #取出了上个接口的token，其他参数可能也通用，然后在引用给下个接口使用
#
# body={
#     "csrfmiddlewaretoken": csrf_token[0],
#     "username:": "admin",
#     "password": "yoyo123456",
#     "next": "/admin/"
# }
#
# r2 = s.post(url, data= body)    #这个s，是第一个接口请求有cookies，所有上一个接口建立会话session 关联起来直接由会话发送第二个请求，怎么判断第二个接口需要cookies，可能第二个请求里边的参数是token这样的隐私数据
# print(r2.text)
# assert "这个字段是必须的" in r2.text
#
#
# #pytest 用例
#
# #运行没有pytest.py，去修改运行器：file-settings-tools-python integrated tools,Default test runner 输入pytest
# def test_func():
#     print("hello world!")
#
# #函数用  test_ 开头命名
#
#
# class Test_demo():
#     def func(self):
#         print('123')
#
# test_func()